package com.petAdoption.manager.service.impl;

import com.petAdoption.manager.entity.Producttype;
import com.petAdoption.manager.mapper.ProducttypeMapper;
import com.petAdoption.manager.service.IProducttypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.petAdoption.manager.vo.ProducttypeVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 王倩茹
 * @since 2023-08-28
 */
@Service
public class ProducttypeServiceImpl extends ServiceImpl<ProducttypeMapper, Producttype> implements IProducttypeService {
    @Resource
    private ProducttypeMapper producttypeMapper;
    @Override
    public List<ProducttypeVO> findAll() {
        return producttypeMapper.findAll();
    }

    @Override
    public List<ProducttypeVO> findByName(String producttypeName) {
        return producttypeMapper.findByName(producttypeName);
    }

    @Override
    public int updateProductType(Producttype producttype) {
        return producttypeMapper.updateProductType(producttype);
    }


    @Override
    public int delProductType(Integer producttypeId) {
        return producttypeMapper.deleteById(producttypeId);
    }

    @Override
    public int addProductType(Producttype producttype) {
        return producttypeMapper.addProductType(producttype);
    }
}
